﻿namespace Crawler.DataAccess
{
    public abstract class DocumentBase : IDocument
    {
        #region IDocument Members

        public abstract string ID { get; set; }

        public abstract string GetDocumentName();

        public string GetDocumentID()
        {
            return GetDocumentID(GetDocumentName(), ID);
        }

        #endregion

        public static string GetDocumentID(string documentName, string id)
        {
            return string.Format("{0}{1}{2}",
                                 documentName,
                                 OttoCommerceDocumentConventions.IdentityPartsSeparator,
                                 id);
        }
    }
}
